/*
 * Copyright (C) 2010-2011 Comcast Cable.  All Rights Reserved.
 */
package com.hercules.android.receiver.model.objects;

import java.util.HashMap;
import java.util.Map;

/**
 * <p>This class represents the Flash SWF file which can be played. The location of the SWF file is provided to the
 * receiver via an URL; and the receiver is  required to load the file using a dedicated socket connection (cannot reuse
 * same socket being used to exchange XRE messages). It is a simple JavaBean (POJO) that provides getters and setters
 * for all private attributes and performs no argument validation in the setters.</p>
 *
 * <p><strong>Thread safety:</strong> This class is mutable and not thread safe.</p>
 *
 * @author saarixx, jmn
 * @version 1.0
 */
public class XREFlash extends XREResource {

    /**
     * <p>The URL of the SWF file.</p>
     *
     * <p>Can be any value.</p>
     *
     * <p>Has getter and setter.</p>
     */
    private String url;

    /**
     * <p>The hash of key / value pairs that are to be given to the Flash SWF as flashvars.</p>
     *
     * <p>Can be any value, can contain any values.</p>
     *
     * <p>Has getter and setter.</p>
     */
    private Map<String, Object> flashVars = new HashMap<String, Object>();

    /**
     * <p>Creates new instance of {@link XREFlash} class.</p>
     */
    public XREFlash() {
        // empty constructor
    }

    /**
     * <p>Retrieves the URL of the SWF file.</p>
     *
     * @return the URL of the SWF file
     */
    public String getUrl() {
        return url;
    }

    /**
     * <p>Sets the URL of the SWF file.</p>
     *
     * @param url the URL of the SWF file
     */
    public void setUrl(String url) {
        this.url = url;
    }

    /**
     * <p>Retrieves the hash of key / value pairs that are to be given to the Flash SWF as flashvars.</p>
     *
     * @return the hash of key / value pairs that are to be given to the Flash SWF as flashvars
     */
    public Map<String, Object> getFlashVars() {
        return flashVars;
    }

    /**
     * <p>Sets the hash of key / value pairs that are to be given to the Flash SWF as flashvars.</p>
     *
     * @param flashVars the hash of key / value pairs that are to be given to the Flash SWF as flashvars
     */
    public void setFlashVars(Map<String, Object> flashVars) {
        this.flashVars = flashVars;
    }
}

